'use client'
import { usePathname } from 'next/navigation'
import s from './index.module.css'
import classNames from '@/utils/classnames'
import { useEffect, useState } from 'react'
type HeaderWrapperProps = {
  children: React.ReactNode
}

const HeaderWrapper = ({
  children,
}: HeaderWrapperProps) => {
  // const [showHeader, setShowHeader] = useState(true)
  const pathname = usePathname()
  // console.log('pathname', pathname)

  // useEffect(() => {
  //   if (
  //     pathname.includes('/documents')
  //     || pathname.includes('/hitTesting')
  //     || pathname.includes('/settings')
  //   )
  //     setShowHeader(false)
  //   else
  //     setShowHeader(true)
  // }, [pathname])

  const isBordered = ['/apps', '/datasets', '/datasets/create', '/tools'].includes(pathname)

  return (
      <div className={classNames(
        'sticky top-0 left-0 right-0 z-30 flex flex-col grow-0 shrink-0 basis-auto min-h-[56px]',
        s.header,
        isBordered ? 'border-b border-divider-regular' : '',
      )}
      >
        {children}
      </div>
    )
}
export default HeaderWrapper
